package cn.bdqn.demo.seckill;

import cn.bdqn.demo.bean.Order;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.jms.Queue;

@Service
public class OrderJmsSenderService {
    @Resource
    JmsMessagingTemplate jmsMessagingTemplate;
    @Resource
    Queue orderQueue;

    public void send(Order order) {
        jmsMessagingTemplate.convertAndSend(orderQueue,order);
        System.out.println(System.currentTimeMillis()+":发送订单消息成功");
    }


}
